Integrand size = 37, antiderivative size = 509 \[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\frac {\sqrt {d} \sqrt {g} \arctan \left (1-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \arctan \left (1+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}+\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}-\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (-\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}}+\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}} \]
[Out]
Time = 0.52 (sec) , antiderivative size = 509, normalized size of antiderivative = 1.00, number of steps used = 16, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.324, Rules used = {2988, 2655, 303, 1176, 631, 210, 1179, 642, 2985, 2984, 504, 1232} \[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=-\frac {2 \sqrt {2} a d \sqrt {g} \sqrt {\sin (e+f x)} \operatorname {EllipticPi}\left (-\frac {\sqrt {b-a}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {\sin (e+f x)+1}}\right ),-1\right )}{b f \sqrt {b-a} \sqrt {a+b} \sqrt {d \sin (e+f x)}}+\frac {2 \sqrt {2} a d \sqrt {g} \sqrt {\sin (e+f x)} \operatorname {EllipticPi}\left (\frac {\sqrt {b-a}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {\sin (e+f x)+1}}\right ),-1\right )}{b f \sqrt {b-a} \sqrt {a+b} \sqrt {d \sin (e+f x)}}+\frac {\sqrt {d} \sqrt {g} \arctan \left (1-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \arctan \left (\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}+1\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \log \left (-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}+\sqrt {g} \cot (e+f x)+\sqrt {g}\right )}{2 \sqrt {2} b f}+\frac {\sqrt {d} \sqrt {g} \log \left (\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}+\sqrt {g} \cot (e+f x)+\sqrt {g}\right )}{2 \sqrt {2} b f} \]
[In]
[Out]
Rule 210
Rule 303
Rule 504
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1232
Rule 2655
Rule 2984
Rule 2985
Rule 2988
Rubi steps \begin{align*} \text {integral}& = \frac {d \int \frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}} \, dx}{b}-\frac {(a d) \int \frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)} (a+b \sin (e+f x))} \, dx}{b} \\ & = -\frac {\left (2 d^2 g\right ) \text {Subst}\left (\int \frac {x^2}{g^2+d^2 x^4} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{b f}-\frac {\left (a d \sqrt {\sin (e+f x)}\right ) \int \frac {\sqrt {g \cos (e+f x)}}{\sqrt {\sin (e+f x)} (a+b \sin (e+f x))} \, dx}{b \sqrt {d \sin (e+f x)}} \\ & = \frac {(d g) \text {Subst}\left (\int \frac {g-d x^2}{g^2+d^2 x^4} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{b f}-\frac {(d g) \text {Subst}\left (\int \frac {g+d x^2}{g^2+d^2 x^4} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{b f}+\frac {\left (4 \sqrt {2} a d g \sqrt {\sin (e+f x)}\right ) \text {Subst}\left (\int \frac {x^2}{\left ((a+b) g^2+(a-b) x^4\right ) \sqrt {1-\frac {x^4}{g^2}}} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {1+\sin (e+f x)}}\right )}{b f \sqrt {d \sin (e+f x)}} \\ & = -\frac {\left (\sqrt {d} \sqrt {g}\right ) \text {Subst}\left (\int \frac {\frac {\sqrt {2} \sqrt {g}}{\sqrt {d}}+2 x}{-\frac {g}{d}-\frac {\sqrt {2} \sqrt {g} x}{\sqrt {d}}-x^2} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}-\frac {\left (\sqrt {d} \sqrt {g}\right ) \text {Subst}\left (\int \frac {\frac {\sqrt {2} \sqrt {g}}{\sqrt {d}}-2 x}{-\frac {g}{d}+\frac {\sqrt {2} \sqrt {g} x}{\sqrt {d}}-x^2} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}-\frac {g \text {Subst}\left (\int \frac {1}{\frac {g}{d}-\frac {\sqrt {2} \sqrt {g} x}{\sqrt {d}}+x^2} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 b f}-\frac {g \text {Subst}\left (\int \frac {1}{\frac {g}{d}+\frac {\sqrt {2} \sqrt {g} x}{\sqrt {d}}+x^2} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 b f}+\frac {\left (2 \sqrt {2} a d g \sqrt {\sin (e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (\sqrt {a+b} g-\sqrt {-a+b} x^2\right ) \sqrt {1-\frac {x^4}{g^2}}} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {1+\sin (e+f x)}}\right )}{b \sqrt {-a+b} f \sqrt {d \sin (e+f x)}}-\frac {\left (2 \sqrt {2} a d g \sqrt {\sin (e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (\sqrt {a+b} g+\sqrt {-a+b} x^2\right ) \sqrt {1-\frac {x^4}{g^2}}} \, dx,x,\frac {\sqrt {g \cos (e+f x)}}{\sqrt {1+\sin (e+f x)}}\right )}{b \sqrt {-a+b} f \sqrt {d \sin (e+f x)}} \\ & = -\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}+\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}-\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (-\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}}+\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}}-\frac {\left (\sqrt {d} \sqrt {g}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}+\frac {\left (\sqrt {d} \sqrt {g}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f} \\ & = \frac {\sqrt {d} \sqrt {g} \arctan \left (1-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \arctan \left (1+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {d \sin (e+f x)}}\right )}{\sqrt {2} b f}-\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)-\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}+\frac {\sqrt {d} \sqrt {g} \log \left (\sqrt {g}+\sqrt {g} \cot (e+f x)+\frac {\sqrt {2} \sqrt {d} \sqrt {g \cos (e+f x)}}{\sqrt {d \sin (e+f x)}}\right )}{2 \sqrt {2} b f}-\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (-\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}}+\frac {2 \sqrt {2} a d \sqrt {g} \operatorname {EllipticPi}\left (\frac {\sqrt {-a+b}}{\sqrt {a+b}},\arcsin \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt {1+\sin (e+f x)}}\right ),-1\right ) \sqrt {\sin (e+f x)}}{b \sqrt {-a+b} \sqrt {a+b} f \sqrt {d \sin (e+f x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 6 vs. order 4 in optimal.
Time = 10.25 (sec) , antiderivative size = 178, normalized size of antiderivative = 0.35 \[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\frac {2 \left (b \operatorname {AppellF1}\left (\frac {3}{4},-\frac {1}{4},1,\frac {7}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right )-a \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{4},1,\frac {7}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right )\right ) (g \cos (e+f x))^{3/2} (d \sin (e+f x))^{3/2} \left (a+b \sqrt {\sin ^2(e+f x)}\right )}{3 \left (a^2-b^2\right ) d f g \sin ^2(e+f x)^{3/4} (a+b \sin (e+f x))} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 853 vs. \(2 (393 ) = 786\).
Time = 2.97 (sec) , antiderivative size = 854, normalized size of antiderivative = 1.68
method | result | size |
default | \(\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \left (a -b \right ) \left (2 i \sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )-i \sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right )-i \sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right )+i \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right ) a +i \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right ) b -i \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right ) a -i \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right ) b -2 \sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )+\sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right )+\sqrt {-a^{2}+b^{2}}\, \Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right )-\Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right ) a -\Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, \frac {a}{-b +\sqrt {-a^{2}+b^{2}}+a}, \frac {\sqrt {2}}{2}\right ) b +\Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right ) a +\Pi \left (\sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}, -\frac {a}{b +\sqrt {-a^{2}+b^{2}}-a}, \frac {\sqrt {2}}{2}\right ) b \right ) \sqrt {g \cos \left (f x +e \right )}\, \sqrt {d \sin \left (f x +e \right )}\, \sqrt {-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )+1}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )}\, \left (\csc \left (f x +e \right )+\sec \left (f x +e \right ) \csc \left (f x +e \right )\right ) \sqrt {2}\, a}{f b \sqrt {-a^{2}+b^{2}}\, \left (-b +\sqrt {-a^{2}+b^{2}}+a \right ) \left (b +\sqrt {-a^{2}+b^{2}}-a \right )}\) | \(854\) |
[In]
[Out]
Timed out. \[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\int \frac {\sqrt {d \sin {\left (e + f x \right )}} \sqrt {g \cos {\left (e + f x \right )}}}{a + b \sin {\left (e + f x \right )}}\, dx \]
[In]
[Out]
\[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\int { \frac {\sqrt {g \cos \left (f x + e\right )} \sqrt {d \sin \left (f x + e\right )}}{b \sin \left (f x + e\right ) + a} \,d x } \]
[In]
[Out]
\[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\int { \frac {\sqrt {g \cos \left (f x + e\right )} \sqrt {d \sin \left (f x + e\right )}}{b \sin \left (f x + e\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}}{a+b \sin (e+f x)} \, dx=\int \frac {\sqrt {g\,\cos \left (e+f\,x\right )}\,\sqrt {d\,\sin \left (e+f\,x\right )}}{a+b\,\sin \left (e+f\,x\right )} \,d x \]
[In]
[Out]